﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true"
    CodeBehind="CongTac.aspx.cs" Inherits="ChamCong.NhanVien.CongTac" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <!--Calendar Script-->
    <link type="text/css" rel="stylesheet" href="../Scripts/JSCal/css/jscal.css" />
    <link type="text/css" rel="stylesheet" href="../Scripts/JSCal/css/border-radius.css" />
    <script type="text/javascript" src="../Scripts/JSCal/js/jscal2.js"></script>
    <script type="text/javascript" src="../Scripts/JSCal/js/lang/vn.js"></script>
    <!--End Calendar-->
    <style type="text/css">
        .style1
        {
            width: 50%;
        }
        .style2
        {
            height: 21px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div>
        <asp:Menu ID="Menu1" runat="server" Orientation="Horizontal" CssClass="childMenu"
            SkipLinkText="">
            <Items>
                <asp:MenuItem Text="Xin Công tác" Value="" NavigateUrl="~/NhanVien/CongTac.aspx">
                </asp:MenuItem>
                <asp:MenuItem Text="Công tác chờ duyệt" Value="" NavigateUrl="~/NhanVien/CongTac.aspx?ttd=0">
                </asp:MenuItem>
                <asp:MenuItem Text="Công tác đã duyệt" Value="" NavigateUrl="~/NhanVien/CongTac.aspx?ttd=1">
                </asp:MenuItem>
                <asp:MenuItem Text="Công tác không duyệt" Value="" NavigateUrl="~/NhanVien/CongTac.aspx?ttd=2">
                </asp:MenuItem>
            </Items>
        </asp:Menu>
        <sbc:sbcMsgBox ID="sbcMsgBox" runat="server" UseJQuery="True" />
    </div>
    <div>
        <table class="style1" align="center" runat="server" id="tbXinCT">
            <tr>
                <td>
                    Họ tên
                </td>
                <td>
                    <asp:Label ID="lblHoTen" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    Mã nhân viên
                </td>
                <td>
                    <asp:Label ID="lblMaNV" runat="server"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:Label ID="lblPhongBan" runat="server" Visible="False"></asp:Label>
                </td>
            </tr>
            <tr>
                <td>
                    Chi tiết công tác
                </td>
                <td>
                    <asp:TextBox ID="tbxChiTiet" runat="server" TextMode="MultiLine"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td>
                    Ngày đi
                </td>
                <td>
                    <asp:TextBox ID="tbxNgayDi" runat="server"></asp:TextBox>
                    <script type="text/javascript">
                        Cal = new Calendar({
                            inputField: "tbxNgayDi",
                            dateFormat: "%d-%m-%Y",
                            trigger: "tbxNgayDi",
                            bottomBar: false,
                            onSelect: function () { this.hide(); }
                        });
                    </script>
                </td>
            </tr>
            <tr>
                <td>
                    Ngày làm việc lại
                </td>
                <td>
                    <asp:TextBox ID="tbxNgayLamViecLai" runat="server"></asp:TextBox>
                    <script type="text/javascript">
                        Cal = new Calendar({
                            inputField: "tbxNgayLamViecLai",
                            dateFormat: "%d-%m-%Y",
                            trigger: "tbxNgayLamViecLai",
                            bottomBar: false,
                            onSelect: function () { this.hide(); }
                        });
                    </script>
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <sbc:sbcMsgBox ID="sbcMsgBox1" runat="server" UseJQuery="True" />
                </td>
            </tr>
            <tr>
                <td class="style2" colspan="2" align="center">
                    <asp:Button ID="btnNop" class="button" runat="server" OnClick="btnNop_Click" Text="Nộp" />
                    <asp:Button ID="btnHuy" class="button" runat="server" Text="Hủy" OnClick="btnHuy_Click" />
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
                <td>
                    <asp:CheckBox ID="cbTinhSoNgay" runat="server" Visible="False" />
                </td>
            </tr>
        </table>
    </div>
    <div style="float: left;">
        <asp:UpdatePanel ID="UpdatePanel1" runat="server">
            <ContentTemplate>
                <asp:GridView ID="grvDSPhepCT" runat="server" AutoGenerateColumns="False" CellPadding="4"
                    ForeColor="#333333" GridLines="None" AllowPaging="True" PageSize="8" OnRowDataBound="grvDSPhepCT_rowdatabound"
                    OnPageIndexChanging="grvDSPhepCT_PageIndexChanging">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="MaPhepCT" HeaderText="Mã phép">
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:BoundField DataField="MaNV" HeaderText="Mã NV" />
                        <asp:BoundField DataField="HoTen" HeaderText="Họ Tên" />
                        <asp:BoundField DataField="NgayDi" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày đi" />
                        <asp:BoundField DataField="NgayLamViecLai" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày làm lại" />
                        <asp:BoundField DataField="SoNgayCT" HeaderText="Số ngày CT">
                            <HeaderStyle Width="35px" HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Trạng thái">
                            <ItemTemplate>
                                <asp:Label ID="lblTrangThaiDuyet" runat="server" Text='<%# ktDuyet(Eval("TrangThaiDuyet")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="NgayTao" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày Tạo">
                            <ItemStyle HorizontalAlign="Center" />
                        </asp:BoundField>
                        <asp:TemplateField HeaderText="Xem">
                            <ItemTemplate>
                                <a href='CongTac.aspx?ttd=<%# LayLoaiDS() %>&MaPhep=<%# Eval("MaPhepCT") %>'>Xem</a>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" CssClass="pager" />
                    <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#E9E7E2" />
                    <SortedAscendingHeaderStyle BackColor="#506C8C" />
                    <SortedDescendingCellStyle BackColor="#FFFDF8" />
                    <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
                </asp:GridView>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
    <div style="float: left; padding-left: 20px;">
        <asp:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
                <asp:DetailsView ID="dtvCTPhepCT" runat="server" Height="50px" Width="220px" Visible="False"
                    AutoGenerateRows="False" BackColor="LightGoldenrodYellow" BorderColor="Tan" BorderWidth="1px"
                    CellPadding="2" ForeColor="Black" GridLines="None">
                    <AlternatingRowStyle BackColor="PaleGoldenrod" />
                    <EditRowStyle BackColor="DarkSlateBlue" ForeColor="GhostWhite" />
                    <Fields>
                        <asp:TemplateField HeaderText="Tên nhân viên">
                            <ItemTemplate>
                                <asp:Label ID="lblTenNV" runat="server" Text='<%# ktTenNV(Eval("MaNV")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:BoundField DataField="MaNV" HeaderText="Phòng ban" />
                        <asp:BoundField DataField="NgayDi" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày đi" />
                        <asp:BoundField DataField="NgayLamViecLai" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày lam" />
                        <asp:BoundField DataField="SoNgayCT" HeaderText="Số ngày công tác" />
                        <asp:BoundField DataField="NgayTao" DataFormatString="{0:dd/MM/yyyy}" HeaderText="Ngày tạo" />
                        <asp:TemplateField HeaderText="Trạng thái">
                            <ItemTemplate>
                                <asp:Label ID="lblTrangThaiDuyet" runat="server" Text='<%# ktDuyet(Eval("TrangThaiDuyet")) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Fields>
                    <FooterStyle BackColor="Tan" />
                    <HeaderStyle BackColor="Tan" Font-Bold="True" />
                    <PagerStyle BackColor="PaleGoldenrod" ForeColor="DarkSlateBlue" HorizontalAlign="Center" />
                </asp:DetailsView>
                <asp:Label ID="lblChuThich" runat="server" Text="Phản hồi:" Visible="False" ForeColor="#FF6600"
                    Font-Italic="True" Font-Bold="True"></asp:Label>
                <br />
                <asp:TextBox ID="tbxChuThich" runat="server" Height="71px" TextMode="MultiLine" Visible="False"
                    Enabled="False"></asp:TextBox>
            </ContentTemplate>
        </asp:UpdatePanel>
    </div>
</asp:Content>
